|
|
|
|
|
|
|
· The BOOLEAN data field type is commonly used to store the results of a bound checkbox input control. It stores only a -1 (True) or 0 (False). For example, if you enter 13 into the input box, Visual Basic stores -1 in the data field. To make matters trickier, Visual Basic does not report an error when a number other than 0 or -1 is entered. You should be careful when using the BOOLEAN data type because any number other than 0 entered into a BOOLEAN data field is converted into -1. |
|
|
|
|
|
|
|
|
· The BYTE data field type only accepts input ranging from -0 to 255. Any other values (including negative numbers) result in a runtime error (error number 524) when you attempt to update the data record. |
|
|
|
|
| |
|
|
|
|
This behavior is changed from Visual Basic 4.0. In the past, Microsoft Jet would automatically convert the invalid value to a byte value and not report an error. For example, if you enter the value 255 (stored as FF in hexadecimal), Visual Basic stores 255 in the data field. If you enter 260 (stored as 0104 in hexadecimalit takes two bytes!), Visual Basic stores a decimal 4 in the data field because the right-most byte is set to hexadecimal 04. |
|
|
|
|
|
|
|
|
|
|
· The COUNTER data field type is a special case. This is an auto-incrementing, read-only data field. Any attempt to write a value to this data field results in a Visual Basic error. Visual Basic keeps track of the integer value to place in this field; it cannot be altered through the input controls or through explicit programming directives. The COUNTER field is often used as a unique primary key field in sequential processing operations. |
|
|
|
|
|
|
|
|
· MEMO and TEXT data field types both accept any character data as valid input. MEMO data fields are built with a default length of 0 (zero). The physical length of a MEMO field is controlled by the total number of characters of data stored in the field. The length of a TEXT field must be declared when the data field is created. The Visual Data Manager that ships with Visual Basic allows the TEXT field to have a length of 1 to 255 bytes. |
|
|
|
|
|
|
|
|
· GUID data field types are used to store a special type of 128-bit numberthe Globally Unique Identifier. This value is used to identify ActiveX components, SQL Server remote procedures, Microsoft Jet replication IDs, and other objects that require a unique identifier. For more on Microsoft Jet replication, see Day 20, "Database Replication." |
|
|
|
|
|